class BoardCategoriesController < ApplicationController
  # GET /board_categories
  # GET /board_categories.json
  def index
    @board_categories = BoardCategory.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @board_categories }
    end
  end

  # GET /board_categories/new
  # GET /board_categories/new.json
  def new
    @board_category = BoardCategory.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @board_category }
    end
  end

  # POST /board_categories
  # POST /board_categories.json
  def create
    @board_category = BoardCategory.new(params[:board_category])

    respond_to do |format|
      if @board_category.save
        format.html { redirect_to board_categories_path, notice: 'Board category was successfully created.' }
        format.json { render json: @board_category, status: :created, location: @board_category }
      else
        format.html { render action: "new" }
        format.json { render json: @board_category.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /board_categories/1
  # DELETE /board_categories/1.json
  def destroy
    @board_category = BoardCategory.find(params[:id])
    @board_category.destroy

    respond_to do |format|
      format.html { redirect_to board_categories_url }
      format.json { head :no_content }
    end
  end
end
